import request from '@/utils/request'

// 查询激励规则配置列表
export function listRules(query) {
  return request({
    url: '/system/rules/list',
    method: 'get',
    params: query
  })
}

// 查询激励规则配置详细
export function getRules(id) {
  return request({
    url: '/system/rules/' + id,
    method: 'get'
  })
}

// 根据类型查询规则
export function listByType(rulesType) {
  return request({
    url: '/system/rules/listByType/' + rulesType,
    method: 'get'
  })
}

// 新增激励规则配置
export function addRules(data) {
  return request({
    url: '/system/rules',
    method: 'post',
    data: data
  })
}

// 修改激励规则配置
export function updateRules(data) {
  return request({
    url: '/system/rules',
    method: 'put',
    data: data
  })
}

// 删除激励规则配置
export function delRules(id) {
  return request({
    url: '/system/rules/' + id,
    method: 'delete'
  })
}
